<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/16
 * Time: 10:43
 */
include_once '../tools/common.php';
include_once '../tools/DbTools.php';
$is_login = getLoginStatus();
if(!$is_login){
    echo '尚未登入，<a href="../manage/adminloginUi.php">请登入</a>';
    die;
}else{
    $AccountCode=$_POST['Code'];
    $AccountPhone=$_POST['Phone'];
    $realName=$_POST['Name'];
    DbTools::InitDb();
    $sql = "insert into accountinfo(AccountCode,AccountPhone,RealName,OpenTime)
            VALUES('$AccountCode','$AccountPhone','$realName',NOW())";
    $result = DbTools::noSelect($sql);
    //关闭连接
    DbTools::close();
    if ($result['status']){
        echo '开户成功！<a href="../manage/adminInfo.php">返回管理员中心</a>';
        echo '<br />';
        echo '<a href="theopencard.php">前去开卡</a>';
    }else {
        echo '开户失败'.$result['message'];
    }
}
